<template>
  <view class="box">
    <view class="tou top" :style="'padding-top:' + statusBarHeight1 + 'px'">
      <image @click="fanhui" src="https://pic.bangbangtongcheng.com/static/back.png" />
      <view class="xuanType">
        <!-- <p @click="typeClick(0)" :class="typeIndex == 0 ? 'xuan' : ''">全部</p> -->
        <!-- <p @click="typeClick(1)" :class="typeIndex == 1 ? 'xuan' : ''">二手房</p>
        <p @click="typeClick(2)" :class="typeIndex == 2 ? 'xuan' : ''">新房</p>
        <p @click="typeClick(3)" :class="typeIndex == 3 ? 'xuan' : ''">租房</p> -->
        <p @click="cutClick(1)" :class="cuts == 1 ? 'xuan' : ''">找房源</p>
        <p @click="cutClick(2)" :class="cuts == 2 ? 'xuan' : ''">找楼盘</p>
        <p @click="cutClick(3)" :class="cuts == 3 ? 'xuan' : ''">找中介</p>
      </view>
    </view>
    <!-- #ifdef MP-WEIXIN -->
    <map
      class="map AppMap"
      :scale="13"
      id="map"
      @regionchange="regionchange"
      :markers="markerList"
      :longitude="logt"
      :latitude="lat"
      :style="'top:' + (statusBarHeight1 + 44) + 'px'"
      @anchorpointtap="regionchange"
    ></map>
    <!-- #endif -->
    <!-- #ifdef H5 -->
    <view id="map" class="map" :style="'top:' + (statusBarHeight1 + 44) + 'px'"></view>
    <!-- #endif -->
    <!-- #ifndef APP -->
    <view class="listBox" :style="'bottom:' + shangyi + 'px'">
      <view>
        <image
          class="dingwei"
          @click="dingwei"
          src="https://pic.bangbangtongcheng.com/static/dingwei1.png"
        />
        <image
          :class="shangyi == 0 ? 'shang xia' : 'shang'"
          src="https://pic.bangbangtongcheng.com/static/you.png"
          @click="listBox_shang"
        />
        <!-- <view class="shangla" @click="listBox_shang"></view> -->
        <view class="listTit">
          该区域内共有
          <span style="color: red"> {{ Recommend.length }} </span>
          <span>{{ cuts == 1 ? '套房源' : cuts == 2 ? '套楼盘' : '个中介' }}</span>
        </view>
        <view class="sous">
          <view class="sous_input">
            <input
              class="sous_input_s"
              v-model="keyword"
              confirm-type="search"
              @confirm="serach"
              placeholder="请输入关键字搜索"
            />
            <image
              class="sous_input_img"
              src="https://pic.bangbangtongcheng.com/static/sousuo1.png"
            ></image>
          </view>
          <view class="sous_btn" @click="serach">
            <text style="font-size: 26rpx; font-weight: 500; color: #ffffff">搜索</text>
          </view>
        </view>
        <!-- <view class="search">
					<view class="sousuo" @click="sousuoClick">
						<image src="https://pic.bangbangtongcheng.com/static/sousuo1.png" />
						<input type="text" style="font-size: 24rpx" v-model="keyword" placeholder="关键字搜索"
							confirm-type="search" @confirm="serach" />
					</view>
				</view> -->
        <view class="flex_bwtween">
          <view class="paixu" @click="showType = !showType" v-if="cuts == 1"> 排序 </view>
          <view class="kuang" v-show="showType && cuts == 1">
            <view :class="orderSort == 1 ? 'item xuan' : 'item'" @click="typeC(1)">按默认排序</view>
            <view :class="orderSort == 2 ? 'item xuan' : 'item'" @click="typeC(2)"
              >按总价从低到高</view
            >
            <view :class="orderSort == 3 ? 'item xuan' : 'item'" @click="typeC(3)"
              >按总价从高到低</view
            >
            <view :class="orderSort == 4 ? 'item xuan' : 'item'" @click="typeC(4)"
              >按面积从小到大</view
            >
          </view>

          <view class="shaixuan" @click="showModal" data-target="DrawerModalR" v-if="cuts == 1"
            >筛选</view
          >
        </view>
        <!-- <view class="listTit">
					<view class="paixu" @click="showType = !showType" v-if="cuts==1"> 排序 </view>
					<view class="kuang" v-show="showType && cuts==1">
						<view :class="orderSort == 1 ? 'item xuan' : 'item'" @click="typeC(1)">按默认排序</view>
						<view :class="orderSort == 2 ? 'item xuan' : 'item'" @click="typeC(2)">按总价从低到高</view>
						<view :class="orderSort == 3 ? 'item xuan' : 'item'" @click="typeC(3)">按总价从高到低</view>
						<view :class="orderSort == 4 ? 'item xuan' : 'item'" @click="typeC(4)">按面积从小到大</view>
					</view>
					<view></view>
					<view class="shaixuan" @click="showModal" data-target="DrawerModalR" v-if="cuts==1">筛选</view>
				</view> -->
        <view class="list" v-if="Recommend.length != 0">
          <scroll-view
            scroll-y
            style="height: 500px"
            lower-threshold="20"
            @scrolltolower="bottomScroll"
            refresher-background="#f5f5f5"
            :scroll-top="scrollTopNum"
            scroll-y
            @scroll="scrollTopFuc"
          >
            <template v-if="cuts == 1">
              <view
                class="li"
                v-for="(item, index) in pagingList"
                :key="index"
                @click="details(item.id)"
              >
                <image
                  :src="item.displayDiagram ? item.displayDiagram : item.houseImage.split('|')[0]"
                  mode="aspectFit"
                />
                <view class="li_1">
                  <view class="tit">
                    <span class="tagLabel">{{
                      item.transactionType == 1 ? '出租房' : item.newOld == 1 ? '新房' : '二手房'
                    }}</span>
                    {{ item.title }}
                  </view>
                  <view class="jiedao">{{ item.region }}</view>
                  <view class="shijian">
                    <span
                      style="margin-right: 24rpx; color: red; font-size: 36rpx; font-weight: 600"
                      v-if="item.transactionType == 2"
                      >{{ item.price }}万</span
                    >

                    <span
                      style="margin-right: 24rpx; color: red; font-size: 36rpx; font-weight: 600"
                      v-else
                      >{{ item.price }}元</span
                    >
                    <span style="margin-right: 14rpx">{{ item.houseType }}</span>
                    <span style>{{ item.area }}㎡</span>
                  </view>
                </view>
              </view>
            </template>
            <template v-else-if="cuts == 2">
              <view
                class="li"
                v-for="(item, index) in pagingList"
                :key="index"
                @click="details(item.id)"
              >
                <image :src="item.showImg ? item.showImg : item.image" mode="aspectFit" />
                <view class="li_1">
                  <view class="tit">{{ item.title }}</view>
                  <view class="jiedao">地址:{{ item.address }}</view>
                  <view class="shijian" v-if="item.averagePrice !== '待定'">
                    <span style>均价:{{ item.averagePrice }}元/㎡ </span>
                  </view>
                  <view class="shijian" v-else>
                    <span style>均价:{{ item.averagePrice }} </span>
                  </view>
                </view>
              </view>
            </template>
            <template v-else-if="cuts == 3">
              <view
                class="li"
                v-for="(item, index) in pagingList"
                :key="index"
                @click="details(item.id)"
              >
                <image :src="item.image" mode="aspectFit" />
                <view class="li_1">
                  <view class="tit">{{ item.shopName }}</view>
                  <view class="jiedao">地址：{{ item.shopAddress }}</view>
                  <view class="shijian"> </view>
                </view>
              </view>
            </template>
          </scroll-view>
        </view>
        <!-- <view class="down" v-show="!downStatus">没有更多了</view> -->
      </view>
      <!-- <view class="didian" v-show="!sousuo" style="height: 519px">
        <view class="sousuo">
          <image src="https://pic.bangbangtongcheng.com/static/sousuo2.png" />
          <input type="text" v-model="keyword" placeholder="搜索地点" />
          <view class="quxiao" v-if="!keyword" @click="sousuoClick">取消</view>
          <view class="quxiao" v-if="keyword" @click="searchList">搜索</view>
        </view>
      </view> -->
      <view class="list" v-if="Recommend.length == 0" style="height: 500px">
        <p
          v-show="cuts == 1"
          style="
            text-align: center;
            font-size: 34rpx;
            color: #666;
            padding-top: 50rpx;
            font-size: 30rpx;
          "
        >
          该区域暂无房源信息，请重新选择
        </p>
        <p
          v-show="cuts == 2"
          style="
            text-align: center;
            font-size: 34rpx;
            color: #666;
            padding-top: 50rpx;
            font-size: 30rpx;
          "
        >
          该区域暂无楼盘信息，请重新选择
        </p>
        <p
          v-show="cuts == 3"
          style="
            text-align: center;
            font-size: 34rpx;
            color: #666;
            padding-top: 50rpx;
            font-size: 30rpx;
          "
        >
          该区域暂无中介信息，请重新选择
        </p>
      </view>
      <view></view>
      <view></view>
    </view>
    <!-- #endif -->
    <!-- #ifndef APP -->
    <view
      class="cu-modal drawer-modal justify-end"
      :class="modalName == 'DrawerModalR' ? 'show' : ''"
      @tap="hideModal"
    >
      <scroll-view scroll-y="true">
        <view
          class="tittit"
          :style="[
            {
              top: 'calc(' + CustomBar1 + 'px' + ' + 36px )',
            },
          ]"
        >
          <view @click="hideModal()">×</view>筛选
        </view>
        <view
          class="cu-dialog basis-lg"
          @tap.stop
          :style="[
            {
              top: 'calc(' + CustomBar1 + 'px' + ' + 36px )',
              height: 'calc(100vh - ' + CustomBar1 + 'px - 36px)',
              maxHeight: 'calc(100vh - ' + CustomBar1 + 'px - 36px)',
            },
          ]"
        >
          <view class="cu-list menu text-left">
            <view class="tit">
              <!-- <view @click="hideModal()">×</view>筛选 -->
            </view>

            <view class="leibie">
              房源类别
              <span style="color: #999999">（请选择房源类别）</span>
              <view class="list">
                <view @click="typeClick(1)" :class="typeIndex == 1 ? 'li xuan' : 'li'">二手房</view>
                <view @click="typeClick(2)" :class="typeIndex == 2 ? 'li xuan' : 'li'">新房</view>
                <view @click="typeClick(3)" :class="typeIndex == 3 ? 'li xuan' : 'li'">租房</view>
              </view>
            </view>
            <view class="leibie">
              类别
              <span style="color: #999999">（请选择类别）</span>
              <view class="list">
                <view
                  @click="type1Click(index)"
                  :class="item.active ? 'li xuan' : 'li'"
                  v-for="(item, index) in type1"
                  :key="index"
                  >{{ item.valueName }}</view
                >
              </view>
            </view>
            <view class="jiage" v-if="typeIndex != 3">
              售价
              <span style="color: #999999">（请选择价格）</span>
              <view class="list">
                <view
                  @click="type8Click(index)"
                  class="li"
                  :class="item.active ? 'li xuan' : 'li'"
                  v-for="(item, index) in type8"
                  :key="index"
                  >{{ item.valueName }}</view
                >
              </view>
            </view>
            <view class="jiage" v-if="typeIndex == 3">
              租金
              <span style="color: #999999">（请选择价格）</span>
              <view class="list">
                <view
                  @click="type12Click(index)"
                  class="li"
                  :class="item.active ? 'li xuan' : 'li'"
                  v-for="(item, index) in type12"
                  :key="index"
                  >{{ item.valueName }}</view
                >
              </view>
            </view>
            <view class="mianji">
              面积
              <span style="color: #999999">（请选择面积）</span>
              <view class="list">
                <view
                  @click="type9Click(index)"
                  class="li"
                  :class="item.active ? 'li xuan' : 'li'"
                  v-for="(item, index) in type9"
                  :key="index"
                  >{{ item.valueName }}</view
                >
              </view>
            </view>
            <view class="loucen">
              楼层
              <span style="color: #999999">（请选择楼层）</span>
              <view class="list">
                <view
                  @click="type10Click(index)"
                  class="li"
                  :class="item.active ? 'li xuan' : 'li'"
                  v-for="(item, index) in type10"
                  :key="index"
                  >{{ item.valueName }}</view
                >
              </view>
            </view>
            <view class="loucen">
              户型
              <span style="color: #999999">（请选择楼层）</span>
              <view class="list">
                <view
                  @click="type3Click(index)"
                  class="li"
                  :class="item.active ? 'li xuan' : 'li'"
                  v-for="(item, index) in type3"
                  :key="index"
                  >{{ item.valueName }}</view
                >
              </view>
            </view>
          </view>
        </view>
        <view class="di">
          <view class="div l" @click="cz">重置</view>
          <view class="div r" @click="sx">确定</view>
        </view>
      </scroll-view>
    </view>
    <!-- #endif -->
    <uniBall></uniBall>
    <uni-popup ref="bindLocationTip" mode="center">
      <view class="binds_frame_bindLocationTip">
        <view class="binds_frame_t"></view>
        <view class="binds_frame_c">您已关闭位置权限<br />或获取位置信息失败</view>
        <view class="binds_frame_b">
          <view class="cancel" @click="$refs.bindLocationTip.close()">取消</view>
          <view class="determine" @click="toLocationSetting()">确定</view>
        </view>
      </view>
    </uni-popup>
  </view>
</template>
<script>
  import permision from '@/js_sdk/wa-permission/permission.js'
  import { mapGetters } from 'vuex'
  import { TMap } from '@/components/TMap'
  //#ifdef H5
  import wxshare from '@/utils/index.js'
  //#endif
  export default {
    data() {
      return {
        scrollTopNum: 0,
        oldScrollTopNum: 0,
        userInfo: uni.getStorageSync('Pduser'),
        typeIndex: '',
        inputForm: {
          id: '',
          user: {
            id: '',
          },
          shopName: '',
          shopType: '',
          shopIntroduce: '',
          shopArea: '',
          shopAddress: '',
          shopPhone: '',
          contacts: '',
          contactsPhone: '',
          image: '',
          longitude: '',
          latitude: '',
          businessLicense: '',
          idCardUp: '',
          idCardDown: '',
          status: '',
          remarks: '',
        },
        markersArray: [],
        markersArrays: [],
        map: '',
        yuanLat: '',
        yuanLogt: '',
        lat: '',
        logt: '',
        shangyi: -315,
        sousuo: true,

        xuan: 1,
        modalName: '',
        leibieLiat: [1],
        pageSize: 10,
        pageNo: 1,
        Recommend: [],
        Recount: '',
        imgUrl: this.$imgSrc,
        showType: false,
        orderSort: '1',
        scrollTop: '0',
        trigger: false,
        downStatus: true,
        upStatus: true,
        userType: '',
        type1: [],
        type3: [],
        type8: [],
        type9: [],
        type10: [],
        type12: [],
        type20: [],
        type7: [],
        keyword: '',
        type: '',
        houseType: '',
        region: '',
        price: '',
        area: '',
        floor: '',
        CustomBar1: '',
        distance: 3000,
        circles: [
          {
            latitude: '',
            longitude: '',
            color: '#000000',
            radius: 3000,
            fillColor: '#FFFFFF1A',
            strokeWidth: 4,
          },
        ],
        _mapContext: null,
        yuan: {},
        markerList: [],
        latitude: '',
        longitude: '',
        cuts: 1,
        //楼盘数据
        buildingData: {},
        // 中介数据
        IntermediaryData: {},
        screenWidth: 300,
        screendw: 0,
        pagingList: [],
        page: 1,
      }
    },
    computed: {
      ...mapGetters(['statusBarHeight1', 'userinfo']),
    },
    onLoad(options) {
      uni.getSystemInfo({
        success: (res) => {
          this.screenWidth = res.screenWidth
        },
      })
      // this.distance = this.screenWidth * 0.8
      this.getType()
      this.CustomBar1 = this.CustomBar
      // if (uni.getStorageSync('locationState') == 1) {
      // }
      this.getLocation();
      // #ifdef H5
      this.jinzhi()
      // #endif
    },
    async onPullDownRefresh() {
      this.Recommend = []
      this.pageNo = 1
      this.downStatus = true
      if (this.upStatus) {
        this.trigger = true
        await this.getRecommend()
      }
    },
    mounted() {
      // #ifdef H5
      this.initMap()
      // #endif
    },
    onUnload() {
      uni.$off('closese')
      uni.$off('confirm')
    },
    methods: {
      // 分页
      getExport() {
        console.log('分页了')
        this.page = 1
        // uni.showLoading()
        this.pagingList = this.getpage(this.page, this.Recommend)
        // uni.hideLoading()
      },
      getpage(page, list) {
        let sindex = (parseInt(page) - 1) * 10
        let eindex = parseInt(page) * 10
        let newList = list.slice(sindex, eindex)
        return newList
      },
      bottomScroll() {
        if (this.pagingList.length == this.Recommend.length) {
          uni.showToast({
            title: '已经到最底部了',
            icon: 'none',
          })
          return
        }
        this.page += 1
        uni.showLoading({
          title: '加载中',
        })
        setTimeout(() => {
          this.pagingList = [...this.pagingList, ...this.getpage(this.page, this.Recommend)]
          uni.hideLoading()
        }, 500)
      },
      scrollTopFuc(e) {
        // console.log(this.oldScrollTopNum)
        // console.log("------------------",this.screendw);
        // if (this.screendw == 0) {
        // 	this.listBox_shang()
        // 	this.screendw = 1
        // }
        //记录scroll  位置
        this.oldScrollTopNum = e.detail.scrollTop

        // if (this.shangyi == 0) {
        //   this.shangyi = -315;
        // } else {
        //   this.shangyi = 0;
        // }
      },
      adjustScrollTop() {
        //视图会发生重新渲染
        this.scrollTopNum = this.oldScrollTopNum
        //当视图渲染结束 重新设置为0
        this.$nextTick(() => {
          this.scrollTopNum = 0
        })
      },

      //wx的自己定位
      WXitself() {
        this.markerList.push({
          id: 2,
          latitude: Number(this.yuanLat),
          longitude: Number(this.yuanLogt),
          iconPath: 'https://pic.bangbangtongcheng.com/523c5245ee0f4ec683aeb3b1910887e0',
          width: 30,
          height: 30,
        })
      },
      // H5的自己定位
      H5itself() {
        var center = new qq.maps.LatLng(this.yuanLat, this.yuanLogt)
        var anchor = new qq.maps.Point(15, 15),
          size = new qq.maps.Size(30, 30),
          scaleSize = new qq.maps.Size(30, 30),
          origin = new qq.maps.Point(0, 0),
          icon = new qq.maps.MarkerImage(
            'https://pic.bangbangtongcheng.com/523c5245ee0f4ec683aeb3b1910887e0',
            size,
            origin,
            anchor,
            scaleSize
          )
        var marker = new qq.maps.Marker({
          icon: icon,
          position: center,
          map: this.map,
        })
        this.markersArrays.push(marker)
      },
      cutClick(cut) {
        switch (cut) {
          //房源
          case 1:
            this.cuts = cut
            // this.agencyPage.pageNo = 1
            break
          //在售楼盘
          case 2:
            this.cuts = cut
            // this.premisesPage.pageNo = 1
            break
          //中介
          case 3:
            this.cuts = cut
            // this.HousesPage.pageNo = 1
            break
        }
        // uni.hideKeyboard()
        this.keyword = ''
        this.Recommend = []
        this.pageNo = 1
        this.getRecommend()
      },
      async getLocation() {
        this.getLocation1()
      },
      toLocationSetting() {
        if (plus.os.name === 'iOS') {
          plus.runtime.openURL('app-settings://')
        } else {
          var Intent = plus.android.importClass('android.content.Intent')
          var Settings = plus.android.importClass('android.provider.Settings')
          var Uri = plus.android.importClass('android.net.Uri')
          var mainActivity = plus.android.runtimeMainActivity()
          var intent = new Intent()
          intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS)
          var uri = Uri.fromParts('package', mainActivity.getPackageName(), null)
          intent.setData(uri)
          mainActivity.startActivity(intent)
        }
      },
      getCenterLanLat() {
        this._mapContext = uni.createMapContext('map', this)
        this._mapContext.getScale({
          success: (res) => {
            this.calculateDis(res.scale)
          },
        })
        this._mapContext.getCenterLocation({
          success: (res) => {
            console.log(111111123321312312)
            this.markerList = []
            let markerList = []
            markerList.push({
              id: 1,
              latitude: res.latitude,
              longitude: res.longitude,
              iconPath: 'https://pic.bangbangtongcheng.com/static/yuan.png',
              width: this.screenWidth,
              height: this.screenWidth,
              anchor: {
                x: 0.5,
                y: 0.5,
              },
            })
            this.yuan = {
              id: 1,
              latitude: res.latitude,
              longitude: res.longitude,
              iconPath: 'https://pic.bangbangtongcheng.com/static/yuan.png',
              width: this.screenWidth,
              height: this.screenWidth,
              anchor: {
                x: 0.5,
                y: 0.5,
              },
            }
            this.lat = res.latitude
            this.logt = res.longitude
            this.markerList = markerList
            this.pageNo = 1
            console.log(this.lat, this.logt)
            this.getRecommend()
          },
          fail() {
            console.log('定位失败？')
          },
        })
      },
      sousuoClick() {
        //this.sousuo = !this.sousuo;
        this.shangyi = -315
      },
      serach() {
        ;(this.pageNo = 1), (this.Recommend = [])
        this.getRecommend()
      },
      details(id) {
        if (this.cuts == 1) {
          uni.navigateTo({
            url: '/pages_houses/housing/used/houseDetails?id=' + id,
          })
        } else if (this.cuts == 2) {
          uni.navigateTo({
            url: '/pages_houses/houses/housesDetails?id=' + id,
          })
        } else if (this.cuts == 3) {
          uni.navigateTo({
            url: '/pages_intermediary/shopDetails?id=' + id,
          })
        }
      },
      jinzhi() {
        let _this = this
        let param = window.location.href.split('#')[0]
        uni.request({
          method: 'post',
          data: {
            url: param,
          },
          header: {
            'content-type': 'application/x-www-form-urlencoded',
          },
          url: 'https://www.bangbangtongcheng.com/conven//mob/login/getJsTicket.do',
          success(re) {
            _this.jinzhifx(re.data)
          },
        })
      },
      jinzhifx(data) {
        wxshare.config({
          debug: false, //是否打开调试
          appId: data.appId, // 公众号的唯一标识
          timestamp: data.timestamp, // 生成签名的时间戳
          nonceStr: data.nonce, // ，生成签名的随机串
          signature: data.signature, // 签名
          jsApiList: ['hideMenuItems'],
        })
        // 禁止分享
        wxshare.hideMenuItems({
          // 要隐藏的菜单项，只能隐藏“传播类”和“保护类”按钮，所有menu项见附录3
          menuList: [
            'menuItem:share:appMessage',
            'menuItem:share:timeline',
            'menuItem:share:timeline',
            'menuItem:share:qq',
            'menuItem:favorite',
            'menuItem:share:QZone',
            'menuItem:openWithSafari',
          ],
        })
      },
      searchList() {
        this.Recommend = []
        this.sousuo = !this.sousuo
        this.getRecommend()
        this.keyword = ''
      },
      typeC(type) {
        this.Recommend = []
        this.showType = !this.showType
        this.orderSort = type
        this.pageNo = 1
        this.getRecommend()
      },
      dingwei() {
        this.lat = this.yuanLat
        this.logt = this.yuanLogt
        this.Recommend = []
        // #ifdef H5
        this.initMap()
        // #endif
      },
      listBox_shang() {
        if (this.shangyi == 0) {
          this.shangyi = -315
          this.screendw = 1
        } else {
          this.shangyi = 0
          this.screendw = 0
        }
      },
      getLocation1() {
        let that = this
        uni.getLocation({
          type: 'gcj02',
          highAccuracyExpireTime: '3000',
          success(res) {
            that.yuanLat = res.latitude
            that.yuanLogt = res.longitude
            that.lat = res.latitude
            that.logt = res.longitude
            console.log(res.latitude, res.longitude, '==')
            // #ifdef H5
            that.initMap()
            // #endif
            // #ifdef MP-WEIXIN
            that.initYuan(that.lat, that.logt)
            // #endif
          },
          fail:(res) => {
            console.log(res, '经纬度没有授权');
            this.$SHOWMODAL_TO_SETTINGS();
            uni.setStorageSync('locationState', 0)
            if (uni.getStorageSync('locationState') == 0) {
              // that.$refs.bindLocationTip.open()
              // uni.showModal({
              // 	title: '提示',
              // 	content: '您已关闭位置权限或获取位置信息失败',
              // 	success: function(res) {
              // 		if (res.confirm) {
              // 			if (plus.os.name === 'iOS') {
              // 				plus.runtime.openURL("app-settings://");
              // 			} else {
              // 				var Intent = plus.android.importClass("android.content.Intent");
              // 				var Settings = plus.android.importClass("android.provider.Settings");
              // 				var Uri = plus.android.importClass("android.net.Uri");
              // 				var mainActivity = plus.android.runtimeMainActivity();
              // 				var intent = new Intent();
              // 				intent.setAction(Settings.ACTION_APPLICATION_DETAILS_SETTINGS);
              // 				var uri = Uri.fromParts("package", mainActivity.getPackageName(), null);
              // 				intent.setData(uri);
              // 				mainActivity.startActivity(intent);
              // 			}
              // 		} else if (res.cancel) {
              // 			console.log('用户点击取消');
              // 		}
              // 	}
              // });
              return false
            }
          },
        })
      },
      initYuan(lat, logt) {
        this.markerList = []
        let markerList = []
        markerList.push({
          id: 1,
          latitude: lat,
          longitude: logt,
          iconPath: 'https://pic.bangbangtongcheng.com/static/yuan.png',
          width: this.screenWidth,
          height: this.screenWidth,
          anchor: {
            x: 0.5,
            y: 0.5,
          },
        })
        this.yuan = {
          id: 1,
          latitude: lat,
          longitude: logt,
          iconPath: 'https://pic.bangbangtongcheng.com/static/yuan.png',
          width: this.screenWidth,
          height: this.screenWidth,
          anchor: {
            x: 0.5,
            y: 0.5,
          },
        }
        this.lat = lat
        this.logt = logt
        this.markerList = markerList
        this.WXitself()
        this.pageNo = 1
        this.getRecommend()
      },
      showModal(e) {
        // #ifndef APP
        this.modalName = e.currentTarget.dataset.target
        // #endif
      },
      hideModal(e) {
        this.modalName = null
      },
      cz() {
        this.type1.forEach((el) => {
          el.active = false
        })
        this.type3.forEach((el) => {
          el.active = false
        })
        this.type8.forEach((el) => {
          el.active = false
        })
        this.type9.forEach((el) => {
          el.active = false
        })
        this.type10.forEach((el) => {
          el.active = false
        })
        this.type12.forEach((el) => {
          el.active = false
        })
        if (this.typeIndex) this.typeIndex = ''
        this.type = ''
        this.houseType = ''
        this.region = ''
        this.price = ''
        this.area = ''
        this.floor = ''
        this.Recommend = []
        this.pageNo = 1
        this.downStatus = true
        this.getRecommend()
      },
      sx() {
        let that = this
        this.type = ''
        this.houseType = ''
        this.region = ''
        this.price = ''
        this.area = ''
        this.floor = ''
        this.type1.forEach((el) => {
          if (el.active == true) {
            that.type = el.valueNum
          }
        })
        this.type3.forEach((el) => {
          console.log(el)
          if (el.active == true) {
            that.houseType = el.valueName
          }
        })
        this.type9.forEach((el) => {
          if (el.active == true) {
            that.area = el.valueName
          }
        })
        this.type10.forEach((el) => {
          console.log(el.valueNum, 11)
          if (el.active == true) {
            that.floor = el.valueNum
          }
        })
        if (this.typeIndex == 3) {
          this.type12.forEach((el) => {
            if (el.active) {
              that.price = el.valueName
            }
          })
        } else {
          this.type8.forEach((el) => {
            if (el.active) {
              that.price = el.valueName
            }
          })
        }
        this.Recommend = []
        this.pageNo = 1
        this.downStatus = true
        this.getRecommend()
      },
      type1Click(index) {
        let that = this
        this.type1.forEach((el, index1) => {
          if (index == index1) {
            that.$set(that.type1[index1], 'active', !el.active)
          } else {
            that.type1[index1].active = false
          }
        })
      },
      type3Click(index) {
        let that = this
        this.type3.forEach((el, index1) => {
          if (index == index1) {
            that.$set(that.type3[index1], 'active', !el.active)
          } else {
            that.type3[index1].active = false
          }
        })
      },
      type7Click(index) {
        let that = this
        this.type7.forEach((el, index1) => {
          if (index == index1) {
            that.$set(that.type7[index1], 'active', !el.active)
          } else {
            that.type7[index1].active = false
          }
        })
      },
      type20Click(index) {
        let that = this
        this.type20.forEach((el, index1) => {
          if (index == index1) {
            that.$set(that.type20[index1], 'active', !el.active)
          } else {
            that.type20[index1].active = false
          }
        })
      },
      type8Click(index) {
        let that = this
        this.type8.forEach((el, index1) => {
          if (index == index1) {
            that.$set(that.type8[index1], 'active', !el.active)
          } else {
            that.type8[index1].active = false
          }
        })
      },
      type9Click(index) {
        let that = this
        this.type9.forEach((el, index1) => {
          if (index == index1) {
            that.$set(that.type9[index1], 'active', !el.active)
          } else {
            that.type9[index1].active = false
          }
        })
      },
      type10Click(index) {
        let that = this
        this.type10.forEach((el, index1) => {
          if (index == index1) {
            console.log(index)
            that.$set(that.type10[index1], 'active', !el.active)
          } else {
            that.type10[index1].active = false
          }
        })
      },
      type12Click(index) {
        let that = this
        this.type12.forEach((el, index1) => {
          if (index == index1) {
            that.$set(that.type12[index1], 'active', !el.active)
          } else {
            that.type12[index1].active = false
          }
        })
      },
      getType() {
        let that = this
        this.$myRequest
          .get('/mob/home/getDictionaries', {
            pageNo: 1,
            pageSize: 10,
            type: '1,8,12,9,10,3,7,20',
          })
          .then((res) => {
            console.log(res)
            res.list.forEach((el) => {
              el.active = false
              if (el.type == 1) {
                that.type1.push(el)
              } else if (el.type == 3) {
                that.type3.push(el)
              } else if (el.type == 8) {
                that.type8.push(el)
              } else if (el.type == 9) {
                that.type9.push(el)
              } else if (el.type == 10) {
                that.type10.push(el)
              } else if (el.type == 12) {
                that.type12.push(el)
              } else if (el.type == 7) {
                that.type7.push(el)
              } else if (el.type == 20) {
                that.type20.push(el)
              }
            })
          })
      },
      getRecommend() {
        this.$myRequest.cancel()
        if (this.markersArrays) {
          for (var i in this.markersArrays) {
            this.markersArrays[i].setMap(null)
          }
          this.markersArrays.length = 0
        }
        var that = this

        // if (this.typeIndex == 0) {
        //   var type = {
        //     transactionType: "",
        //     newOld: "",
        //   };
        // } else if (this.typeIndex == 1) {
        //   var type = {
        //     transactionType: "",
        //     newOld: 2,
        //   };
        // } else if (this.typeIndex == 2) {
        //   var type = {
        //     transactionType: "",
        //     newOld: 1,
        //   };
        // } else if (this.typeIndex == 3) {
        //   var type = {
        //     transactionType: 1,
        //     newOld: "",
        //   };
        // }
        let transactionType = ''
        let newOld = ''
        if (this.typeIndex == 0) {
        } else if (this.typeIndex == 1) {
          newOld = 2
          transactionType = 2
        } else if (this.typeIndex == 2) {
          newOld = 1
          transactionType = 2
        } else if (this.typeIndex == 3) {
          transactionType = 1
        }
        this.upStatus = false
        if (this.cuts == 1) {
          this.$myRequest
            .get('/mob/home/getHouseByMap', {
              pageSize: 9999,
              pageNo: this.pageNo,
              userIds: this.userInfo.id,
              distance: this.distance,
              latitude: this.lat,
              longitude: this.logt,
              transactionType: transactionType,
              newOld: newOld,
              orderSort: this.orderSort, //2低-》高,3相反
              keyword: this.keyword,
              type: this.type,
              houseType: this.houseType,
              region: this.region,
              pricee: this.price,
              area: this.area,
              upStatus: 1,
              examineStatus: 2,
              floor: this.floor,
              // userId: this.userInfo.id,
            })
            .then((res) => {
              let houseNumber = res.page.list.length
              let toHouse = Number(String(houseNumber).substring(0, 1)) + 1
              // #ifdef H5
              that.downStatus = false
              that.upStatus = true
              that.trigger = false
              if (res.success && res.page.count > 0) {
                that.Recommend = res.page.list
                that.Recount = res.page.count
                that.markersArrays = []
                this.getExport()
                res.page.list.forEach((e, i) => {
                  if (res.page.list.length > 100) {
                    if (i % toHouse == 0) {
                      var center = new qq.maps.LatLng(e.latitude, e.longitude)
                      var anchor = new qq.maps.Point(15, 15),
                        size = new qq.maps.Size(30, 30),
                        scaleSize = new qq.maps.Size(30, 30),
                        origin = new qq.maps.Point(0, 0),
                        icon = new qq.maps.MarkerImage(
                          'https://pic.bangbangtongcheng.com/locationpic.png',
                          size,
                          origin,
                          anchor,
                          scaleSize
                        )
                      var marker = new qq.maps.Marker({
                        icon: icon,
                        position: center,
                        map: that.map,
                      })
                      that.markersArrays.push(marker)
                      this.H5itself()
                    }
                  } else {
                    var center = new qq.maps.LatLng(e.latitude, e.longitude)
                    var anchor = new qq.maps.Point(15, 15),
                      size = new qq.maps.Size(30, 30),
                      scaleSize = new qq.maps.Size(30, 30),
                      origin = new qq.maps.Point(0, 0),
                      icon = new qq.maps.MarkerImage(
                        'https://pic.bangbangtongcheng.com/locationpic.png',
                        size,
                        origin,
                        anchor,
                        scaleSize
                      )
                    var marker = new qq.maps.Marker({
                      icon: icon,
                      position: center,
                      map: that.map,
                    })
                    that.markersArrays.push(marker)
                    this.H5itself()
                  }
                })
                // 调整位置
                that.adjustScrollTop()
              } else {
                uni.showToast({
                  title: '定位失败',
                  icon: 'none',
                  mask: true,
                })
                return
              }

              uni.stopPullDownRefresh()

              // #endif
              // #ifdef MP-WEIXIN
              that.Recommend = res.page.list
              that.Recount = res.page.count
              let markers = []
              markers.push(that.yuan)
              this.getExport()
              res.page.list.forEach((e) => {
                markers.push({
                  id: Number(e.id),
                  latitude: Number(e.latitude),
                  longitude: Number(e.longitude),
                  iconPath: 'https://pic.bangbangtongcheng.com/locationpic.png',
                  width: 30,
                  height: 30,
                })
              })
              this.markerList = markers
              this.WXitself()
              // 调整位置
              that.adjustScrollTop()
              console.log(this.markerList)
              // #endif
            })
        } else if (this.cuts == 2) {
          this.$myRequest
            .get('/mob/user/getBuildingsInfo', {
              pageSize: 999,
              pageNo: this.pageNo,
              distance: this.distance,
              latitude: this.lat,
              longitude: this.logt,
              keyword: this.keyword,
              auditStatus: 2,
            })
            .then((res) => {
              // #ifdef H5
              that.downStatus = false
              that.upStatus = true
              that.trigger = false
              console.log(res, '1---------')
              if (res.success && res.page.count > 0) {
                that.Recommend = res.page.list
                that.Recount = res.page.count
                that.markersArrays = []
                this.getExport()
                res.page.list.forEach((e) => {
                  var center = new qq.maps.LatLng(e.latitude, e.longitude)
                  var anchor = new qq.maps.Point(15, 15),
                    size = new qq.maps.Size(30, 30),
                    scaleSize = new qq.maps.Size(30, 30),
                    origin = new qq.maps.Point(0, 0),
                    icon = new qq.maps.MarkerImage(
                      'https://pic.bangbangtongcheng.com/locationpic.png',
                      size,
                      origin,
                      anchor,
                      scaleSize
                    )
                  var marker = new qq.maps.Marker({
                    icon: icon,
                    position: center,
                    map: that.map,
                  })
                  that.markersArrays.push(marker)
                  this.H5itself()
                })
                // 调整位置
                that.adjustScrollTop()
              } else {
                uni.showToast({
                  title: '定位失败',
                  icon: 'none',
                  mask: true,
                })
                return
              }

              uni.stopPullDownRefresh()

              // #endif
              // #ifdef MP-WEIXIN
              that.Recommend = res.page.list
              that.Recount = res.page.count
              let markers = []
              markers.push(that.yuan)
              this.getExport()
              res.page.list.forEach((e) => {
                markers.push({
                  id: Number(e.id),
                  latitude: Number(e.latitude),
                  longitude: Number(e.longitude),
                  iconPath: 'https://pic.bangbangtongcheng.com/locationpic.png',
                  width: 30,
                  height: 30,
                })
              })
              this.markerList = markers
              this.WXitself()
              // 调整位置
              that.adjustScrollTop()
              console.log(this.markerList)
              // #endif
            })
        } else if (this.cuts == 3) {
          this.$myRequest
            .get('/mob/user/getShopInfo', {
              pageSize: 999,
              pageNo: this.pageNo,
              distance: this.distance,
              latitude: this.lat,
              longitude: this.logt,
              keyword: this.keyword,
              status: 1,
              shopType: 1,
            })
            .then((res) => {
              // #ifdef H5
              that.downStatus = false
              that.upStatus = true
              that.trigger = false
              console.log(res, '1---------')
              if (res.success && res.page.count > 0) {
                that.Recommend = res.page.list
                that.Recount = res.page.count
                that.markersArrays = []
                this.getExport()
                res.page.list.forEach((e) => {
                  var center = new qq.maps.LatLng(e.latitude, e.longitude)
                  var anchor = new qq.maps.Point(15, 15),
                    size = new qq.maps.Size(30, 30),
                    scaleSize = new qq.maps.Size(30, 30),
                    origin = new qq.maps.Point(0, 0),
                    icon = new qq.maps.MarkerImage(
                      'https://pic.bangbangtongcheng.com/locationpic.png',
                      size,
                      origin,
                      anchor,
                      scaleSize
                    )
                  var marker = new qq.maps.Marker({
                    icon: icon,
                    position: center,
                    map: that.map,
                  })
                  that.markersArrays.push(marker)
                  this.H5itself()
                })
                // 调整位置
                that.adjustScrollTop()
              } else {
                uni.showToast({
                  title: '定位失败',
                  icon: 'none',
                  mask: true,
                })
                return
              }

              uni.stopPullDownRefresh()

              // #endif
              // #ifdef MP-WEIXIN
              that.Recommend = res.page.list
              that.Recount = res.page.count
              let markers = []
              this.getExport()
              markers.push(that.yuan)
              res.page.list.forEach((e) => {
                markers.push({
                  id: Number(e.id),
                  latitude: Number(e.latitude),
                  longitude: Number(e.longitude),
                  iconPath: 'https://pic.bangbangtongcheng.com/locationpic.png',
                  width: 30,
                  height: 30,
                })
              })
              this.markerList = markers
              this.WXitself()
              // 调整位置
              that.adjustScrollTop()
              console.log(this.markerList)
              // #endif
            })
        }
      },
      fanhui() {
        uni.navigateBack({
          delta: 1,
        })
      },
      typeClick(num) {
        this.typeIndex = num
        this.sx()
      },
      regionchange(e) {
        console.log(e.causedBy, e.type)
        // #ifdef MP-WEIXIN
        if ((e.causedBy == 'drag' || e.causedBy == 'scale') && e.type == 'end') {
          this.getCenterLanLat()
        }
        // #endif
        // #ifdef APP
        if (
          e.causedBy == 'drag' ||
          e.causedBy == 'scale' ||
          (e.causedBy == 'update' && e.type == 'end')
        ) {
          this.getCenterLanLat()
        }
        // #endif
      },

      initMap() {
        TMap().then((qq) => {
          var that = this
          let address = ''
          let lat = that.lat
          let logt = that.logt
          console.log(lat, logt, '==')
          // let lat = "30.495204298172805";
          // let logt = "114.41768825054169";
          var center = new qq.maps.LatLng(lat, logt)
          var map = new qq.maps.Map(document.getElementById('map'), {
            center: center,
            zoom: 13,
            disableDefaultUI: true,
          })
          this.map = map
          // console.log(map, 1314);

          lat = map.getCenter().lat
          logt = map.getCenter().lng
          var anchor = new qq.maps.Point(this.screenWidth / 2, this.screenWidth / 2),
            size = new qq.maps.Size(this.screenWidth, this.screenWidth),
            scaleSize = new qq.maps.Size(this.screenWidth, this.screenWidth),
            origin = new qq.maps.Point(0, 0),
            icon = new qq.maps.MarkerImage(
              'https://pic.bangbangtongcheng.com/61d928e58d47472891609adfc954148f.png',
              size,
              origin,
              anchor,
              scaleSize
            )
          var marker = new qq.maps.Marker({
            icon: icon,
            position: center,
            map: map,
          })
          that.markersArray.push(marker)
          this.H5itself()
          // var markers = new qq.maps.Marker({
          //   // icon: icon,
          //   position: center,
          //   map: map,
          // });
          // that.markersArray.push(markers);
          that.getRecommend()
          qq.maps.event.addListener(map, 'center_changed', function () {
            that.Recommend = []
            that.deleteOverlays()
            lat = map.getCenter().lat
            logt = map.getCenter().lng
            that.lat = lat
            that.logt = logt
            let center = new qq.maps.LatLng(lat, logt)
            marker = new qq.maps.Marker({
              icon: icon,
              position: center,
              map: map,
            })
            console.log(lat, logt, '拖拽地图')
            that.markersArray.push(marker)
            that.getRecommend()
          })
          qq.maps.event.addListener(map, 'zoom_changed', function () {
            that.Recommend = []
            var zoomLevel = map.getZoom()
            that.calculateDis(zoomLevel)
            console.log(zoomLevel)
          })
        })
      },
      calculateDis(index) {
        //根据地图比例计算收缩范围
        console.log('缩放级别：' + index)
        let num = index
        var scalx = 8.5
        // #ifdef MP-WEIXIN
        var scalx = Math.min(
          8.5,
          Math.max(
            8.5 -
              (parseFloat(num).toFixed(1) - 6 >= 10
                ? (20 - parseFloat(num).toFixed(1)) * 2.4
                : parseFloat(num).toFixed(1) - 6) *
                0.32,
            5.4
          )
        )
        // #endif
        let r = uni.getSystemInfoSync().screenWidth * scalx //像素半径
        if (3 <= num && num < 4) {
          //代表1000KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数  就是 1000到500的过程
          if (zoom >= 4) {
            this.distance = r * 500
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减500的过程 就是平均减 500/10 50的过程
            this.distance = r * (1000 - number * 50)
          }
        }
        if (4 <= num && num < 5) {
          //代表500KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数 就是 500到200的过程
          if (zoom >= 5) {
            this.distance = r * 200
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减200的过程 就是平均减 200/10 20的过程
            this.distance = r * (500 - number * 20)
          }
        }
        if (5 <= num && num < 6) {
          //代表200KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数  就是 200到100的过程
          if (zoom >= 6) {
            this.distance = r * 100
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减100的过程 就是平均减 100/10 10的过程
            this.distance = r * (200 - number * 10)
          }
        }
        if (6 <= num && num < 7) {
          //代表100KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数   就是 100到50的过程
          if (zoom >= 7) {
            this.distance = r * 50
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减50的过程 就是平均减 50/10 5的过程
            this.distance = r * (100 - number * 5)
          }
        }
        if (7 <= num && num < 8) {
          //代表50KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数   就是 50到30的过程
          if (zoom >= 8) {
            this.distance = r * 30
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减20的过程 就是平均减 20/10 2的过程
            this.distance = r * (52 - number * 2)
          }
        }
        if (8 <= num && num < 9) {
          //代表30KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数  就是 30到20的过程
          if (zoom >= 9) {
            this.distance = r * 20
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减10的过程 就是平均减 10/10 1的过程
            this.distance = r * (30 - number * 1)
          }
        }
        if (9 <= num && num < 10) {
          //代表20KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数  就是 20到10的过程
          if (zoom >= 10) {
            this.distance = r * 10
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减10的过程 就是平均减 10/10 1的过程
            this.distance = r * (18 - number * 1)
          }
        }
        if (10 <= num && num < 11) {
          //代表10KM
          let zoom = parseFloat(num).toFixed(1) //保留一位小数  就是 10到5的过程
          if (zoom >= 11) {
            this.distance = r * 5
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减5的过程 就是平均减 5/10 0.5的过程
            this.distance = r * (9 - number * 0.5)
          }
        }
        if (11 <= num && num < 12) {
          //代表5km
          let zoom = parseFloat(num).toFixed(1) //保留一位小数   就是 5到2的过程
          if (zoom >= 12) {
            this.distance = r * 2
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减3的过程 就是平均减 3/10 0.3的过程
            this.distance = r * (5 - number * 0.3)
          }
        }
        if (12 <= num && num < 13) {
          //代表2km
          let zoom = parseFloat(num).toFixed(1) //保留一位小数    就是 2到1的过程
          if (zoom >= 13) {
            this.distance = r * 1
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减1的过程 就是平均减 1/10 0.1的过程
            this.distance = r * (2 - number * 0.1)
          }
        }
        if (13 <= num && num < 14) {
          //代表1km
          let zoom = parseFloat(num).toFixed(1) //保留一位小数 就是 1KM到500的过程
          if (zoom >= 14) {
            this.distance = r * 0.6
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减0.5的过程 就是平均减 0.5/10 0.05的过程
            this.distance = r * (1.1 - number * 0.05)
          }
        }
        if (14 <= num && num < 15) {
          //代表500m
          let zoom = parseFloat(num).toFixed(1) //保留一位小数  小  就是 500到200的过程
          if (zoom >= 15) {
            this.distance = r * 0.3
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减0.3的过程 就是平均减 0.3/10 0.03的过程
            this.distance = r * (0.6 - number * 0.03)
          }
        }
        if (15 <= num && num < 16) {
          //代表200m
          let zoom = parseFloat(num).toFixed(1) //保留一位小数    就是 200到100的过程
          if (zoom >= 16) {
            this.distance = r * 0.12
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减0.1的过程 就是平均减 0.1/10 0.01的过程
            this.distance = r * (0.3 - number * 0.01)
          }
        }
        if (16 <= num && num < 17) {
          //代表100m
          let zoom = parseFloat(num).toFixed(1) //保留一位小数    就是 100到50的过程
          if (zoom >= 17) {
            this.distance = r * 0.065
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减0.05的过程 就是平均减 0.05/10 0.005的过程
            this.distance = r * (0.12 - number * 0.005)
          }
        }
        if (17 <= num && num < 18) {
          //代表50
          let zoom = parseFloat(num).toFixed(1) //保留一位小数   就是 50到25的过程
          if (zoom >= 18) {
            this.distance = r * 0.027
          } else {
            let number = zoom.substring(zoom.lastIndexOf('.') + 1) //就是0到9 递归减0.025的过程 就是平均减 0.025/10 0.0025的过程
            this.distance = r * (0.065 - number * 0.0025)
          }
        }
        if (18 <= num && num < 19) {
          //代表25m
          this.distance = r * 0.027
        }
        if (19 <= num && num < 20) {
          //代表10m
          this.distance = r * 0.001
        }
        if (20 <= num) {
          //代表10m
          this.distance = r * 0.001
        }
        console.log('当前查询范围2' + this.distance)
        console.log('屏幕宽度' + uni.getSystemInfoSync().screenWidth)
        console.log('比例尺等级' + num)
      },
      deleteOverlays() {
        if (this.markersArray) {
          for (var i in this.markersArray) {
            this.markersArray[i].setMap(null)
          }
          this.markersArray.length = 0
        }
        if (this.markersArrays) {
          for (var i in this.markersArrays) {
            this.markersArrays[i].setMap(null)
          }
          this.markersArrays.length = 0
        }
      },
      async up() {
        this.Recommend = []
        if (this.markersArrays) {
          for (var i in this.markersArrays) {
            this.markersArrays[i].setMap(null)
          }
          this.markersArrays.length = 0
        }
        this.pageNo = 1
        this.downStatus = true
        if (this.upStatus) {
          this.trigger = true
          await this.getRecommend()
        }
      },
      down() {
        if (this.Recount == this.Recommend.length) {
          return
        }
        if (this.downStatus) {
          this.pageNo++
          this.getRecommend()
        }
      },
    },
  }
</script>
<style lang="less" scoped>
  .sous {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    margin-top: 16rpx;
    margin-bottom: 16rpx;
    padding: 0 30rpx;
  }
  .sous_input {
    position: relative;
  }
  .sous_input_s {
    width: 480rpx;
    height: 68rpx;
    border-radius: 37rpx;
    border: 1px solid #999999;
    padding-left: 75rpx;
    font-size: 26rpx;
  }
  .sous_input_img {
    width: 50rpx;
    height: 50rpx;
    position: absolute;
    top: 6rpx;
    left: 10rpx;
  }
  .sous_btn {
    width: 152rpx;
    height: 68rpx;
    background-color: #64b6a8;
    border-radius: 37rpx;
    color: #fff;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
  }
  .tittit {
    position: fixed;
    top: 0;
    right: 0;
    background-color: #f8f8f8;
    z-index: 9999;
    max-width: 100%;
    width: 600rpx;
    transition-duration: 0.3s;
    transform: translateX(100%);

    text-align: center;
    line-height: 80rpx;
    font-size: 30rpx;
    border-bottom: 2rpx solid #cccccc;

    view {
      position: absolute;
      top: 0rpx;
      left: 20rpx;
      color: #999999;
      font-size: 54rpx;
      font-weight: 100;
    }
  }

  .show .tittit {
    transform: translateX(0%);
  }

  .box {
    position: absolute;
    width: 100%;
    top: 0;
    bottom: 0;
    color: #333;
    background-color: #fff;
  }

  .didian {
    position: relative;
    width: 690rpx;
    margin-left: 50%;
    transform: translateX(-50%);

    .sousuo {
      position: relative;
      width: 686rpx;
      height: 72rpx;
      margin-top: 30rpx;
      border: 2rpx solid #64b6a8;
      border-radius: 36rpx;

      image {
        display: inline-block;
        width: 50rpx;
        height: 50rpx;
        margin-left: 20rpx;
        margin-top: 12rpx;
      }

      input {
        display: inline-block;
        width: 400rpx;
        height: 50rpx;
        line-height: 52rpx;
        margin-top: 12rpx;
        vertical-align: top;
        font-size: 28rpx;
      }

      .quxiao {
        position: absolute;
        top: 4rpx;
        right: 4rpx;
        width: 120rpx;
        height: 60rpx;
        line-height: 60rpx;
        color: #fff;
        text-align: center;
        background: #64b6a8;
        border-radius: 30rpx;
      }
    }
  }

  .tou {
    position: relative;
    width: 100%;
    // height: 88rpx;
    text-align: center;
    line-height: 88rpx;
    font-size: 36rpx;
    color: #333;
    background-color: #fff;

    image {
      position: absolute;
      width: 32rpx;
      height: 32rpx;
      // top: 116rpx;
      // top: 40rpx;
      left: 30rpx;
    }

    .xuanType {
      display: inline-block;
      margin-left: -50rpx;
      /* #ifdef MP-WEIXIN */
      // margin-left: -226rpx;

      /* #endif */
      p {
        display: inline-block;
        vertical-align: middle;
        margin-right: 54rpx;
        font-size: 32rpx;
        color: #333333;
        /* #ifdef MP-WEIXIN */
        margin-right: 27rpx;
        /* #endif */
      }

      .xuan {
        transform: scale(1.1);
        color: #64b6a8;
      }
    }
  }

  .map {
    position: absolute !important;
    top: 100rpx;
    bottom: 500rpx;
    width: 100%;
  }

  .listBox {
    position: fixed;
    bottom: 0px;
    width: 100%;
    padding-top: 50rpx;
    background-color: #fff;

    .shangla {
      position: absolute;
      top: -4rpx;
      left: 0;
      display: inline-block;
      vertical-align: middle;
      width: 180rpx;
      height: 56rpx;
      line-height: 56rpx;
      border-radius: 30rpx;
      color: #999999;
      border: 2rpx solid #e0e0e0;
      text-align: center;
      font-weight: 400;
      font-size: 19rpx;

      image {
        position: absolute;
        width: 32rpx;
        height: 32rpx;
        top: 12rpx;
        left: 5rpx;
      }
    }

    .dingwei {
      position: absolute;
      top: -160rpx;
      right: 30rpx;
      width: 90rpx;
      height: 110rpx;
    }

    .shang {
      position: absolute;
      top: 8rpx;
      width: 21rpx;
      height: 37rpx;
      transform: rotate(-90deg);
      left: 50%;
      margin-left: -18rpx;
    }

    .xia {
      transform: rotate(90deg);
    }
    .flex_bwtween {
      display: flex;
      padding: 0 30rpx;
      justify-content: space-between;
      position: relative;
      .paixu {
        display: inline-block;
        vertical-align: middle;
        color: #64b6a8;
        font-weight: 400;
        display: flex;
        align-items: center;
        margin-right: 10rpx;
      }

      .paixu::after {
        // position: absolute;
        content: '';
        top: 12rpx;
        left: 70rpx;
        width: 0;
        height: 0;
        border-color: #64b6a8 rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
        border-style: solid;
        border-width: 14rpx 8rpx 0rpx 8rpx;
      }

      .shaixuan {
        display: inline-block;
        // position: relative;
        font-size: 32rpx;
        right: 60rpx;
        display: flex;
        align-items: center;
        /* #ifdef MP-WEIXIN */
        // right: 254rpx;
        // line-height: 90rpx;
        /* #endif */
      }

      .shaixuan::after {
        // position: absolute;
        content: '';
        // top: 36rpx;
        // left: 80rpx;
        width: 0;
        height: 0;
        border-color: #333 rgba(0, 0, 0, 0) rgba(0, 0, 0, 0) rgba(0, 0, 0, 0);
        border-style: solid;
        border-width: 14rpx 8rpx 0rpx 8rpx;
      }

      .kuang {
        // position: relative;
        background-color: #fff;
        z-index: 10000;
      }
    }
    .listTit {
      position: relative;
      width: 690rpx;
      margin: 10rpx 0;
      margin-left: 50%;
      transform: translate(-50%);
      text-align: center;
      font-size: 32rpx;
      font-weight: 600;
      z-index: 9999;

      .sousuo {
        position: absolute;
        top: -4rpx;
        left: 0;
        display: flex;
        /* vertical-align: middle; */
        align-items: center;
        width: 180rpx;
        height: 56rpx;
        line-height: 56rpx;
        border-radius: 30rpx;
        color: #999999;
        border: 2rpx solid #e0e0e0;
        text-align: center;
        font-weight: 400;
        font-size: 19rpx;

        image {
          position: absolute;
          width: 32rpx;
          height: 32rpx;
          top: 12rpx;
          left: 5rpx;
        }
      }

      .fang {
        position: absolute;
        top: -10rpx;
        right: 50rpx;
        content: '';
        width: 30rpx;
        height: 30rpx;
        background-color: #fff;
        transform: rotate(45deg);
        box-shadow: 0 0 8rpx 4rpx rgba(0, 0, 0, 0.3);
        z-index: -1;
      }
    }
  }

  .kuang {
    position: absolute;
    left: 30rpx;
    top: 60rpx;
    // background: #fff;
    width: 330rpx;
    padding: 0 30rpx;
    z-index: 20;
    box-shadow: 0 0 8rpx 4rpx rgba(0, 0, 0, 0.3);

    .item {
      height: 90rpx;
      line-height: 90rpx;
      border-bottom: 2rpx solid #e0e0e0;
    }

    .item:last-child {
      border-bottom: 0;
    }

    .xuan {
      color: #64b6a8;
    }
  }

  .list {
    margin-top: 20rpx;
    margin-left: 30rpx;
    width: 720rpx;

    .tit {
      color: #333333;
      font-size: 36rpx;
      margin-bottom: 24rpx;
    }

    .li {
      width: 96%;
      padding-bottom: 30rpx;
      margin-bottom: 30rpx;
      border-bottom: 2rpx solid #e0e0e0;

      image {
        width: 300rpx;
        height: 200rpx;
      }

      .li_1 {
        position: relative;
        display: inline-block;
        vertical-align: top;
        margin-left: 24rpx;

        .tit {
          width: 366rpx;
          font-size: 36rpx;
          line-height: 44rpx;
          font-weight: 600;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2; //想要的行数
          -webkit-box-orient: vertical;
          .tagLabel {
            vertical-align: top;
            background: #64b6a8;
            color: #fff;
            font-size: 24rpx;
            text-align: center;
            width: 106rpx;
            margin-right: 10rpx;
            padding: 4rpx 6rpx;
            border-radius: 4rpx;
          }
        }

        .jiedao {
          width: 366rpx;
          font-size: 24rpx;
          margin-bottom: 14rpx;
          color: #666666;
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2; //想要的行数
          -webkit-box-orient: vertical;
        }

        .shijian {
          bottom: 4rpx;
          font-size: 26rpx;
        }
      }
    }

    .li:last-child {
      border-bottom: 0rpx solid #e0e0e0;
    }
  }

  /deep/.map a {
    display: none !important;
  }
</style>
<style lang="less" scoped>
  .cu-list {
    padding-bottom: 98rpx;

    .tit {
      position: relative;
      width: 100%;
      height: 80rpx;
      text-align: center;
      line-height: 80rpx;
      font-size: 30rpx;
      border-bottom: 2rpx solid #cccccc;

      view {
        position: absolute;
        top: 0rpx;
        left: 20rpx;
        color: #999999;
        font-size: 54rpx;
        font-weight: 100;
      }
    }

    .leibie {
      margin-top: 40rpx;
      font-size: 28rpx;
      margin-left: 40rpx;

      .list {
        width: 100%;
        margin-top: 24rpx;

        .li {
          display: inline-block;
          text-align: center;
          width: 154rpx;
          height: 60rpx;
          line-height: 60rpx;
          background: #f2f2f2;
          border-radius: 30rpx;
          margin-right: 24rpx;
          margin-bottom: 24rpx;
        }

        .xuan {
          background: #64b6a8;
          color: #fff;
        }
      }
    }

    .quyu {
      margin-top: 40rpx;
      font-size: 28rpx;
      margin-left: 40rpx;

      .list {
        width: 100%;
        margin-top: 24rpx;

        .li {
          display: inline-block;
          text-align: center;
          width: 154rpx;
          height: 60rpx;
          line-height: 60rpx;
          background: #f2f2f2;
          border-radius: 30rpx;
          margin-right: 24rpx;
          margin-bottom: 24rpx;
        }

        .xuan {
          background: #64b6a8;
          color: #fff;
        }
      }
    }

    .jiage {
      margin-top: 40rpx;
      font-size: 28rpx;
      margin-left: 40rpx;

      .list {
        width: 100%;
        margin-top: 24rpx;

        .li {
          display: inline-block;
          text-align: center;
          width: 214rpx;
          height: 60rpx;
          line-height: 60rpx;
          background: #f2f2f2;
          border-radius: 30rpx;
          margin-right: 24rpx;
          margin-bottom: 24rpx;
        }

        .xuan {
          background: #64b6a8;
          color: #fff;
        }
      }
    }

    .mianji {
      margin-top: 40rpx;
      font-size: 28rpx;
      margin-left: 40rpx;

      .list {
        width: 100%;
        margin-top: 24rpx;

        .li {
          display: inline-block;
          text-align: center;
          width: 214rpx;
          height: 60rpx;
          line-height: 60rpx;
          background: #f2f2f2;
          border-radius: 30rpx;
          margin-right: 24rpx;
          margin-bottom: 24rpx;
        }

        .xuan {
          background: #64b6a8;
          color: #fff;
        }
      }
    }

    .loucen {
      margin-top: 40rpx;
      font-size: 28rpx;
      margin-left: 40rpx;

      .list {
        width: 100%;
        margin-top: 24rpx;

        .li {
          display: inline-block;
          text-align: center;
          width: 154rpx;
          height: 60rpx;
          line-height: 60rpx;
          background: #f2f2f2;
          border-radius: 30rpx;
          margin-right: 24rpx;
          margin-bottom: 24rpx;
        }

        .lis {
          display: inline-block;
          text-align: center;
          width: 240rpx;
          height: 60rpx;
          line-height: 60rpx;
          background: #f2f2f2;
          border-radius: 30rpx;
          margin-right: 24rpx;
          margin-bottom: 24rpx;
        }

        .xuan {
          background: #64b6a8;
          color: #fff;
        }
      }
    }
  }

  .cu-dialog {
    max-width: 100%;
    width: 600rpx;
  }

  .basis-lg {
    flex-basis: 600rpx;
    overflow: auto;
  }

  .di {
    position: fixed;
    width: 100%;
    bottom: 0rpx;
    left: 74rpx;

    .div {
      display: inline-block;
      width: 300rpx;
      height: 98rpx;
      text-align: center;
      line-height: 98rpx;
      font-size: 30rpx;
    }

    .l {
      background: #e0e0e0;
    }

    .r {
      background: #64b6a8;
      color: #fff;
    }
  }

  .tower-swiper {
    height: 300rpx;
  }

  .tower-swiper .tower-item {
    transform: scale(calc(0.5 + var(--index) / 10));
    margin-left: calc(var(--left) * 100upx - 150upx);
    z-index: var(--index);
    width: 390rpx;
    height: 260rpx;
    left: 44%;
    box-shadow: 0px 13px 12px rgba(0, 0, 0, 0.2);
  }

  .tower-swiper .tower-item.none {
    opacity: 1;
  }

  .Ptop {
    /* #ifdef H5 || APP-PULS */
    // padding-top: 104rpx;
    margin-top: 98rpx;
    /* #endif */

    /* #ifdef MP  */
    // margin-top: 188rpx;
    /* #endif */
  }

  .fixed {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 40;
  }

  .down {
    height: 60rpx;
    line-height: 60rpx;
    text-align: center;
  }

  .none {
    text-align: center;

    image {
      width: 430rpx;
      margin-bottom: 16rpx;
    }

    view {
      height: 40rpx;
      line-height: 40rpx;
      color: #666;
    }
  }

  .AppMap {
    height: 60%;
  }
</style>
